<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>

<div id="contenedor">
	<div class="estiloDiv">
		<h1 style="font-family: sans-serif; margin: 20px">
			<s:property value="getText('global.grid.titulo')" />
		</h1>

		<s:url id="remoteurl" action="Usuarios" />
		<s:url id="editurl" action="edit-grid-entry" />
		<sjg:grid id="gridtable" caption="%{getText('global.grid.name')}" dataType="json"
			href="%{remoteurl}" pager="true" gridModel="gridModel"
			rowList="10,15,20" rowNum="10" autowidth="true" navigator="true"
			navigatorAddOptions="{height:280,reloadAfterSubmit:true,}"
			navigatorEditOptions="{height:280,reloadAfterSubmit:true}"
			navigatorSearch="false" navigatorEdit="true" navigatorDelete="true"
			navigatorDeleteOptions="{height:280,reloadAfterSubmit:true}"
			editurl="%{editurl}" editinline="false" onSelectRowTopics="rowselect"
			onEditInlineSuccessTopics="oneditsuccess" viewrecords="true"
			rownumbers="true">
			<sjg:gridColumn name="id" index="id" title="ID" sortable="true"
				formatter="integer" searchoptions="false" editable="false"
				align="center" />
			<sjg:gridColumn name="name" index="name" title="%{getText('global.grid.name')}"
				sortable="true" editable="true" edittype="text"
				editrules="{
    					required: true, 				
    				}" />
			<sjg:gridColumn name="clave" index="clave" title="%{getText('global.grid.clave')}"
				sortable="true" editable="true" edittype="text"
				editrules="{
    					required: true, 				
    				}" />
			<sjg:gridColumn name="nombre" index="nombre" title="%{getText('global.grid.nombre')}"
				sortable="true" editable="true" edittype="text"
				editrules="{
    					required: true, 				
    				}" />
			<sjg:gridColumn name="apellido" index="apellido" title="%{getText('global.grid.apellido')}"
				sortable="true" editable="true" edittype="text"
				editrules="{
    					required: true, 				
    				}" />
			<sjg:gridColumn name="perfil" index="perfil" title="%{getText('global.grid.perfil')}"
				sortable="true" editable="true" edittype="select"
				editoptions="{value:'usuario:usuario;administrador:administrador'}" />
			<sjg:gridColumn name="email" index="email" title="%{getText('global.grid.email')}"
				sortable="true" editable="true" edittype="text" />
			<sjg:gridColumn name="telefono" index="telefono" title="%{getText('global.grid.telefono')}"
				sortable="true" editable="true"
				editrules="{
    					number: true,
    					required: true,
    					minValue : 1000000,
    					maxValue : 999999999
    				}" />
		</sjg:grid>
	</div>
</div>